package com.meixiang.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yinsujun  Created at 2016/6/27 13:22
 */
public class HomeData implements Parcelable {

    private List<String> bannerImgae;
    /**
     * goodsId : 108
     * goodsImage : http://www.mxaest.com:8080/upload/img/store/39/1449112967862.jpg_430x430q90.jpg
     * goodsName : 张一元红茶
     */

    private List<GoodsListBean> goodsList;

    public List<String> getBannerImgae() {
        return bannerImgae;
    }

    public void setBannerImgae(List<String> bannerImgae) {
        this.bannerImgae = bannerImgae;
    }

    public List<GoodsListBean> getGoodsList() {
        return goodsList;
    }

    public void setGoodsList(List<GoodsListBean> goodsList) {
        this.goodsList = goodsList;
    }

    public static class GoodsListBean implements Parcelable {
        private String goodsId;
        private String goodsImage;
        private String goodsName;
        private String type;

        public String getGoodsId() {
            return goodsId;
        }

        public void setGoodsId(String goodsId) {
            this.goodsId = goodsId;
        }

        public String getGoodsImage() {
            return goodsImage;
        }

        public void setGoodsImage(String goodsImage) {
            this.goodsImage = goodsImage;
        }

        public String getGoodsName() {
            return goodsName;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = goodsName;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.goodsId);
            dest.writeString(this.goodsImage);
            dest.writeString(this.goodsName);
            dest.writeString(this.type);
        }

        public GoodsListBean() {
        }

        protected GoodsListBean(Parcel in) {
            this.goodsId = in.readString();
            this.goodsImage = in.readString();
            this.goodsName = in.readString();
            this.type=in.readString();
        }

        public static final Creator<GoodsListBean> CREATOR = new Creator<GoodsListBean>() {
            @Override
            public GoodsListBean createFromParcel(Parcel source) {
                return new GoodsListBean(source);
            }

            @Override
            public GoodsListBean[] newArray(int size) {
                return new GoodsListBean[size];
            }
        };
        @Override
        public String toString() {
            return "GoodsListBean{" +
                    "goodsId='" + goodsId + '\'' +
                    ", goodsImage='" + goodsImage + '\'' +
                    ", goodsName='" + goodsName + '\'' +
                    ", type='" + type + '\'' +
                    '}';
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeStringList(this.bannerImgae);
        dest.writeList(this.goodsList);
    }

    public HomeData() {
    }

    protected HomeData(Parcel in) {
        this.bannerImgae = in.createStringArrayList();
        this.goodsList = new ArrayList<GoodsListBean>();
        in.readList(this.goodsList, GoodsListBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<HomeData> CREATOR = new Parcelable.Creator<HomeData>() {
        @Override
        public HomeData createFromParcel(Parcel source) {
            return new HomeData(source);
        }

        @Override
        public HomeData[] newArray(int size) {
            return new HomeData[size];
        }
    };

    @Override
    public String toString() {
        return "HomeData{" +
                "bannerImgae=" + bannerImgae +
                ", goodsList=" + goodsList +
                '}';
    }
}
